<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

// 用户旷工等级名称
function get_level_name($level){
    $level_name='注册用户';
    switch ($level){
        case 1:$level_name='体验旷工';break;
        case 2:$level_name='实习旷工';break;
        case 3:$level_name='正式旷工';break;
        case 4:$level_name='原始旷工';break;
        case 5:$level_name='钢铁旷工';break;
        case 6:$level_name='青铜旷工';break;
        case 7:$level_name='白银旷工';break;
        case 8:$level_name='黄金旷工';break;
        case 9:$level_name='钻石旷工';break;
    }
    return $level_name;
}
//  用户推广等级
function get_share_name($level){
    $level_name='注册用户';
    switch ($level){
        case 1:$level_name='原始矿主';break;
        case 2:$level_name='奴隶矿主';break;
        case 3:$level_name='封建矿主';break;
        case 4:$level_name='半封建半殖民地矿主';break;
        case 5:$level_name='社会主义矿主';break;
        case 6:$level_name='HX推广者';break;
        case 7:$level_name='HX使者';break;
        case 8:$level_name='HX推广大使';break;
    }
    return $level_name;
}
// 获取头像和昵称
function getInfo($id)
{
    return \think\Db::name('users')->where('id',$id)->find();
}
// 获取旷工的信息
function getWorkerInfo($id){
    return \think\Db::name('worker')->where('id',$id)->find();
}
// 开始价格
function getStartPrice(){
    $start=\think\Db::name('system')->where('sys_name','start')->value('price');
    return $start;
}
// 结束价格
function getEndPrice(){
    $end=\think\Db::name('system')->where('sys_name','end')->value('price');
    return $end;
}